<!DOCTYPE html>
<html ng-app="sales">
<head>
    <meta charset="UTF-8">
    <head>
        <base href="/">
    </head>
    <title>华成保险--{{title}}</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="icon" type="image/x-icon" href="/favicon.ico">
    <link rel="stylesheet" type="text/css" href="/css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="/css/bootstrap-datetimepicker.min.css">
    <link rel="stylesheet" type="text/css" href="/css/font-awesome.min.css">
    <!-- <link rel="stylesheet" type="text/css" href="/css/new_ui.css"> -->
    <link rel="stylesheet" type="text/css" href="/css/c3.min.css">
    <link rel="stylesheet" type="text/css" href="/css/ui.css">
    <link rel="stylesheet" type="text/css" href="/css/status-color.css">
    <link rel="stylesheet" type="text/css" href="/css/sweetalert.css">


    <script src="/js/jquery-2.1.3.min.js"></script>
    <script src="/js/bootstrap.min.js"></script>
    <!-- <script src="/js/angular.min.js"></script> -->
    <script src="/js/angular.min.js"></script>
    <script src="/js/angular-animate.js"></script>
    <script src="/js/angular-route.min.js"></script>
    <script src="/js/jquery.shapeshift.min.js"></script>
    <script src="/js/bootstrap-datetimepicker.js"></script>
    <script type="text/javascript" src="/js/ag-grid.min.js"></script>
    <!-- <script src="/js/alert.js"></script> -->
    <script type="text/javascript" src="/js/sweetalert.min.js"></script>


    <style>
        .ag-row-selected {
            border-left: 0.3em solid #d81313;
        }

    </style>
</head>
<body>

<div class="container-main">
    <!--顶-->
    <!--<div class="header-line" ng-init="header_user = false;">-->
    <!--<div class="header-line-logo">-->
    <!--&lt;!&ndash; <img src="/images/login-login-1.png"> &ndash;&gt;-->
    <!--<img src="/images/ins-logo-trans.png" style="width: 140px;">-->
    <!--</div>-->
    <!--<div class="header-line-content">-->
    <!--<div class="header-welcome">-->
    <!--欢迎：{{user.name}}@{{user._shop.name}}-->
    <!--</div>-->
    <!--<div class="header-user" ng-click="header_user = !header_user;">-->
    <!--<span class="header-username"><i class="fa fa-user" style="padding-right: 5px;color: #f3f3f3;"></i>{{user.name}}</span>-->
    <!--<i class="fa fa-sort-desc header-desc"></i>-->
    <!--<div class="header-user-menu" ng-show="header_user">-->
    <!--<div class="header-user-item">-->
    <!--{{user.name}}@{{user._shop.name}}-->
    <!--</div>-->
    <!--<div class="header-user-item" ng-click="toggle_help = !toggle_help">-->
    <!--<i class="fa fa-book"></i>-->
    <!--帮助:{{toggle_help?"打开":"关闭"}}-->
    <!--</div>-->
    <!--<div class="header-user-item" onclick="logout()">-->
    <!--<i class="fa fa-sign-out"></i>-->
    <!--登出-->
    <!--</div>-->
    <!--</div>-->
    <!--</div>-->

    <!--</div>-->
    <!--</div>-->

    <div class="content-main">
        <div class="content-main-overlay">

            <div class="view-container">
                <div class="view-menu">
                    <div class="view-menu-item" ng-repeat='menu_item in menus.index'>
                        <div ng-click="open_module(menu_item,$index)" class="view-menu-item-name"
                             ng-class="{true:'view-menu-item-name-check', false:''}[menu_item.icon]">
                            {{menu_item.rolename}}
                        </div>
                    </div>
                    <div class="view-menu-item" ng-repeat='menu_item in menus.insurance'>
                        <div ng-click="open_module(menu_item,$index)" class="view-menu-item-name"
                             ng-class="{true:'view-menu-item-name-check', false:''}[menu_item.icon]">
                            {{menu_item.rolename}}
                        </div>
                    </div>
                    <div class="view-menu-item" style="position: relative;" ng-init="view_menu_admin = false;">
                        <div class="view-menu-item-name" ng-click="view_menu_admin = !view_menu_admin">
                            权限系统
                            <!-- <span class="fa fa-unsorted"></span> -->
                            <span class="fa fa-angle-down"></span>
                        </div>
                        <div ng-show="view_menu_admin" class="view-menu-admin"
                             ng-click="view_menu_admin = !view_menu_admin;">
                            <div ng-repeat='admin_item in menus.admin' class="view-menu-admin-item"
                                 ng-click="open_module(admin_item,$index)">
                                {{admin_item.rolename}}
                            </div>
                        </div>
                    </div>
                    <div class="view-menu-item" ng-show="admin_rolename_show">
                        <div class="view-menu-item-name view-menu-item-name-check" style="border-right: 0px;">
                            {{admin_rolename}}
                        </div>
                    </div>

                </div>
                <div class="view-body">
                    <ng-view></ng-view>
                </div>
            </div>
        </div>

    </div>

    <!--<div class="menus_close" ng-show="view_menu_admin == true" ng-click="view_menu_admin = false;"></div>-->
</div>
<style>
    .notification {
        display: inline-block;
        position: fixed;
        z-index: 8000;
        width: 25em;
        background: #fff;
        bottom: 5px;
        right: 5px;
        border: 1px solid #bd9d66;

    }
    .notification .c{
        width:100%;
        overflow-y: scroll;
        background: #fff;
    }

    .notification .bar{
        margin: 0.2em;
        border-radius: 3px;
        background: #f3f3f3;
    }

    .notification .head{
        height : 2em;
        /*padding: 0.25em 0;*/
        line-height: 2em;
        color: #333;
        font-size: 0.9em;
        background: #bd9d66;
        /*text-align: center;*/
        cursor: pointer;
        display: flex;
        width: 100%;
        box-sizing: border-box;
        padding-right: 15px;
    }
    .notification div{
        text-align: center;
        flex-grow:1;
    }
    .notification span{
        /*width: 10%;*/
        /*text-align: right;*/
        /*height: 2em;*/
        /*line-height: 2em;*/
        margin: 0.5em 0;
        padding: 0.1em 0.3em;
    }
    .notification span:hover{
        /*width: 10%;*/
        /*text-align: right;*/
        /*height: 2em;*/
        /*line-height: 2em;*/
        background: #a58550;
    }


    .notice-container{
        position: fixed;
        top: 98px;
        right: 0;
        display: flex;
        box-sizing: border-box;
    }
    .notice-menu{
        width: 50px;
        height: 50px;
        line-height: 50px;
        background: #f6f8f8;
        border: 1px solid #dee5e7;
        box-sizing: border-box;
        cursor: pointer;
        text-align: center;
        font-size: 1.2em;
        color: #144069;
        border-right: 0;
    }
    .notice-content{
        /*        position: fixed;
            top: 98px;
            right: 0;*/
        width: 0px;

        background: #f6f8f8;
        box-sizing: border-box;
        /*border: 1px solid #dee5e7;*/
        background: #fff;
    }
    .notice-title{
        background: #f6f8f8;
        border: 1px solid #dee5e7;
        height: 50px;
        width: 100%;
        line-height: 50px;
        font-size: 0.9em;
        text-align: center;
        border-right: 0;
        border-left: 0;
    }
    .notice-body{
        width: 100%;
        height: 100%;
        border: 1px solid #dee5e7;
        height: 380px;
        border-top: 0;
        border-right: 0;
        overflow-y: auto;
        overflow-x: auto;
    }

</style>
<!--<div class="notice-container" ng-init="noti_show = false">-->
<!--<div class="notice-menu" ng-click="noti_show = !noti_show">-->
<!--<span class="fa fa-th-large"></span>-->
<!--</div>-->
<!--<div class="notice-content notice-ease" style="width : {{(noti_show?'300px':'0')}}">-->
<!--<div class="notice-title">消息中心</div>-->
<!--<div class="notice-body">-->
<!--<div class="bar" ng-repeat="item in notifications track by item.id">-->
<!--<noti ng-model="item"></noti>-->
<!--</div>-->
<!--</div>-->
<!--</div>-->
<!--</div>-->
<script src="/app.js"></script>
<script src="/main.js"></script>


<script>
    $(document).ready(function(){
        // $(window).resize(function(event) {
        //     var w = $(window).width();
        //     if (w <= '1024') {
        //         $(".home-menu-max-logo").hide();
        //     }
        // });
        $(".insurance-menu-toggle").click(function(event) {
            $(".insurance-logo").toggle();
            $(".insurance-menu").toggle();
            $(".insurance-menu-list ul").toggle();
            $(".home-menu").toggleClass('menu-max');
            $(".home-view").toggleClass('view-max');
        });
//        $(".home-menu-toggle").click(function(event) {
//            console.log($(".home-menu").width());
//            $(".new-module").position().left = 50;
//            $(".new-module").toggle();
//        });

        // $(".home-menu-list ul").click(function(event) {
        //     if ($(window).width() <= '1024') {
        //         $(".home-menu-max-img").toggle();
        //         $(".home-menu-max-logo").toggle();
        //         $(".home-menu-list ul").toggle();
        //         $(".home-menu").toggleClass('menu-max');
        //         $(".home-view").toggleClass('view-max');
        //     }
        // });


        /*sweet alert replacement*/
        // console.log(navigator.userAgent);
        if (navigator.userAgent.indexOf('Windows NT') > -1 || navigator.userAgent.indexOf('Linux') > -1){
            window.alert = function(txt){
                swal(txt);
            }
        }
        // window.confirm = function(txt,fn){
        //     var t = swal({
        //         title:txt,
        //         text:txt,
        //         type: "warning",
        //         showCancelButton: true,
        //         confirmButtonColor: "#DD6B55",
        //         confirmButtonText: "删除",
        //         closeOnConfirm: false
        //     });
        //      console.log(t);
        // }
    });
    //Submits an invalid authentication header, causing the user to be 'logged out'
    function logout() {
        $.ajax({
            url: '/api/sys/logout',
            type: 'post',
            headers: {
                Authorization: require('AUTH').getToken()
            },
            dataType: 'json',
            success: function (data) {
                require('AUTH').setToken(null);
                window.location.href = '/login';
            }
        });
    }
    $(".home-user").hover(function(){
        $(".home-user-logout").toggle();
    });



</script>
</body>
</html>
